module.exports = () => {
  return (req, res, next) => {
    res.response = (code = 200, msg = '请求成功', data = null) => res.send({ code, msg, data })
    next()
  }
}